# Maintainer: micbou <contact@micbou.com>

pkgname=libqrencode-git
pkgver=v3.4.3.r243.g1ef82bd
pkgrel=1
pkgdesc='QR Code encoding library'
arch=('i686' 'x86_64')
url='https://fukuchi.org/works/qrencode/'
license=('LGPL')
makedepends=('git' 'gcc')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=(git+https://github.com/fukuchi/libqrencode)
sha256sums=('SKIP')

pkgver() {
  cd "${srcdir}/${pkgname%-git}"
  git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "${srcdir}/${pkgname%-git}"
  ./autogen.sh
}

build() {
  cd "${srcdir}/${pkgname%-git}"
  ./configure \
    --prefix=/usr

  make LDFLAGS="${LDFLAGS} -no-undefined"
}

package() {
  cd "${srcdir}/${pkgname%-git}"
  make DESTDIR=${pkgdir} install
}
